﻿@model System.Collections.Specialized.OrderedDictionary

@{
    ViewBag.Title = "Edit Data Record";
}

<h2>Edit Data Record for @ViewBag.TableName</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Datum</legend>

        @foreach(System.Collections.Specialized.OrderedDictionary item in ViewBag.Data.Values)
        {
            foreach(System.Collections.DictionaryEntry entry in item)
            {
                if (@entry.Key.ToString() != "DataID")
                {
                    <div class="editor-label">
                        @entry.Key.ToString()
                    </div>
                    <div class="editor-field">
                        <input type="hidden" name="DataName" id="DataName" value="@entry.Key.ToString()" />
                        <input type="text" name="@entry.Key.ToString()" id="@entry.Key.ToString()" value="@entry.Value.ToString()" />
                    </div>
                }
            }
        }
         <p>
           <input type="hidden" name="TableMasterID" value="@ViewBag.TableMasterID" /> 
           <input type="hidden" name="DataID" value="@ViewBag.DataID" />
           <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index", new { id = ViewBag.TableMasterID })
</div>
        @{Html.RenderAction("_ListDataTables", "DataTable");}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
